#pragma once
#include<iostream>
#define  valueType int
using namespace std;
namespace GIS20124
{
	struct node
	{
		valueType value;
		node* next;
	};

	void function(node* root, int mink, int maxk)
	{
		node* cur = root;
		node* nextnode = root->next;
		node* pre = nullptr;
		node* newnode = nullptr;
		while (cur != nullptr)
		{
			if (cur->value < maxk && cur->value > mink && cur == root)
			{
				free(cur);
				root = cur;
			}
			else if (cur->value < maxk && cur->value > mink)
			{
				free(cur);
				pre->next = nextnode;
			}
			else
			{
				pre = cur;

			}

			if (nextnode)
			{
				cur = nextnode;
				nextnode = nextnode->next;
			}

		}
	}
}